package ru.home.documentmanager.controller;

import org.springframework.security.core.context.SecurityContextHolder;

import ru.home.documentmanager.model.User;
import ru.home.documentmanager.model.dto.UserModel;

public abstract class AppController {

    protected User getCurrentUser() {
        return ((UserModel) SecurityContextHolder.getContext()
                .getAuthentication().getPrincipal()).getUserObject();
    }

}
